#include "OpenGLVertexArrayObject.h"
POCELAIN_NAMESPACE_BEGIN
OpenGLVertexArrayObject::OpenGLVertexArrayObject()
{
    glGenVertexArrays(1,&mVAOName);
    if(mVAOName==OPENGL_INVALID_VAO_NUM)
    {
        POCELAIN_LOG_ERROR("glGenVertexArrays error");
    }
}
OpenGLVertexArrayObject::~OpenGLVertexArrayObject()
{
    if(mVAOName!=OPENGL_INVALID_VAO_NUM&&
            glIsVertexArray(mVAOName)==GL_TRUE)
    {
        glDeleteVertexArrays(1,&mVAOName);
    }
}
void OpenGLVertexArrayObject::bind()
{
    glBindVertexArray(mVAOName);
}
void OpenGLVertexArrayObject::unbind()
{
    glBindVertexArray(0);
}
POCELAIN_NAMESPACE_END
